function enter() {
    var b = cm.getPortal().getId();
    var a = cm.getPortal().getName();
    cm.openScriptNpc()
}
var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(e, c, b) {
    if (status == 0 && e == 0) {
        cm.dispose();
        return
    }(e == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            var d = cm.getNumberFromQuestInfo(33181, "army");
            if (cm.isQuestFinished(33184)) {
                cm.effect_NormalSpeechBalloon("得去监狱看看情况。", 1, 0, 0, 2000, 0, 0, 0, 0, 4, 0, cm.getPlayer().getId());
                cm.dispose()
            } else {
                if (d >= 3) {
                    cm.sendNormalTalk_Bottom("这里已经清空了，得去其他房间看看！", 36, 1540624, false, true);
                    cm.dispose()
                } else {
                    if (d < 2) {
                        cm.sendNormalTalk_Bottom("还有士兵没有救出来！", 36, 1540624, false, true);
                        cm.dispose()
                    } else {
                        cm.curNodeEventEnd(true);
                        cm.setInGameDirectionMode(true, false, true);
                        cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 500, 0);
                        cm.inGameDirectionEvent_AskAnswerTime(500)
                    }
                }
            }
        } else {
            if (status === a++) {
                cm.dispose();
                cm.warp(350031007, 1, true)
            }
        }
    }
};